using System;
using System.Web.Security;

namespace IWS.Lib.SingleSignOn
{
	public class MembershipUserProxy
	{
		string m_Comment;
		DateTime m_CreationDate;
		string m_Email;
		bool m_IsApproved;
		bool m_IsLockedOut;
		bool m_IsOnline;
		DateTime m_LastActivityDate;
		DateTime m_LastLoginDate;
		DateTime m_LastPasswordChangedDate;
		DateTime m_LastLockOutDate;
		string m_PasswordQuestion;
		string m_ProviderName;
		object m_ProviderUserKey;
		string m_UserName;

		/// <summary>
		/// Create a new membershipuserproxy
		/// </summary>
		public MembershipUserProxy()
		{
			init();
		}
		public MembershipUserProxy(MembershipUser user)
		{
			this.Comment = user.Comment;
			this.CreationDate = user.CreationDate;
			this.Email = user.Email;
			this.IsApproved = user.IsApproved;
			this.IsLockedOut = user.IsLockedOut;
			this.IsOnline = user.IsOnline;
			this.LastActivityDate = user.LastActivityDate;
			this.LastLoginDate = user.LastLoginDate;
			this.LastActivityDate = user.LastActivityDate;
			this.LastPasswordChangedDate = user.LastPasswordChangedDate;
			this.PasswordQuestion = user.PasswordQuestion;
			this.ProviderName = user.ProviderName;
			this.ProviderUserKey = user.ProviderUserKey;
			this.UserName = user.UserName;
			this.LastLockOutDate = user.LastLockoutDate;
		}

		private void init()
		{
			m_Comment = "";
			m_CreationDate = DateTime.MinValue;
			m_Email = "";
			m_IsApproved = false;
			m_IsLockedOut = false;
			m_IsOnline = false;
			m_LastActivityDate = DateTime.MinValue;
			m_LastLoginDate = DateTime.MinValue;
			m_LastPasswordChangedDate = DateTime.MinValue;
			m_LastLockOutDate = DateTime.MinValue;
			m_PasswordQuestion = "";
			m_ProviderName = "";
			m_ProviderUserKey = "";
			m_UserName = "";
		}


		#region Properties
		public string Comment
		{
			get { return m_Comment; }
			set { m_Comment = value; }
		}
		public DateTime CreationDate
		{
			get { return m_CreationDate; }
			set { m_CreationDate = value; }
		}
		public string Email
		{
			get { return m_Email; }
			set { m_Email = value; }
		}
		public bool IsApproved
		{
			get { return m_IsApproved; }
			set { m_IsApproved = value; }
		}
		public bool IsLockedOut
		{
			get { return m_IsLockedOut; }
			set { m_IsLockedOut = value; }
		}
		public bool IsOnline
		{
			get { return m_IsOnline; }
			set { m_IsOnline = value; }
		}
		public DateTime LastActivityDate
		{
			get { return m_LastActivityDate; }
			set { m_LastActivityDate = value; }
		}
		public DateTime LastLoginDate
		{
			get { return m_LastLoginDate; }
			set { m_LastLoginDate = value; }
		}
		public DateTime LastPasswordChangedDate
		{
			get { return m_LastPasswordChangedDate; }
			set { m_LastPasswordChangedDate = value; }
		}
		public string PasswordQuestion
		{
			get { return m_PasswordQuestion; }
			set { m_PasswordQuestion = value; }
		}
		public string ProviderName
		{
			get { return m_ProviderName; }
			set { m_ProviderName = value; }
		}
		public object ProviderUserKey
		{
			get { return m_ProviderUserKey; }
			set { m_ProviderUserKey = value; }
		}
		public string UserName
		{
			get { return m_UserName; }
			set { m_UserName = value; }
		}
		public DateTime LastLockOutDate
		{
			get { return m_LastLockOutDate; }
			set { m_LastLockOutDate = value; }
		}

		#endregion

		public MembershipUser GetMembershipUser()
		{
			return new MembershipUser(this.ProviderName, this.UserName, this.ProviderUserKey, this.Email, this.PasswordQuestion, this.Comment, this.IsApproved, this.IsLockedOut, this.CreationDate, this.LastLoginDate, this.LastActivityDate, this.LastPasswordChangedDate, this.LastLockOutDate);
		}
	}
}
